
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
     
    <html xmlns="http://www.w3.org/1999/xhtml">
    
<head>  

    <script type="text/javascript" src="http://c.csdnimg.cn/pubfooter/js/tracking.js" charset="utf-8"></script>  

    <script type="text/javascript">
        var protocol = window.location.protocol;
        document.write('<script type="text/javascript" src="' + protocol + '//csdnimg.cn/pubfooter/js/repoAddr2.js?v=' + Math.random() + '"></' + 'script>');
    </script>

  
 <meta http-equiv="Cache-Control" content="no-siteapp" /><link rel="alternate" media="handheld" href="#" />

    <title>原创springmvc+spring3+hibernate4框架整合,实现增删改查功能 - 低调如我的博客
        - 博客频道 - CSDN.NET</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="description" content="上网查了很多,才认识到框架分不同的版本,版本不同,相对应的jar包也不同,所有就自己整合了一个框架,希望能帮助大家" />
    <script src="http://static.blog.csdn.net/scripts/jquery.js" type="text/javascript"></script>
      <script type="text/javascript" src="http://static.blog.csdn.net/scripts/jquery-version.js"></script>
    <script type="text/javascript" src="http://static.blog.csdn.net/scripts/ad.js?v=1.1"></script>
        <!--new top-->
               <link rel="stylesheet" href="http://c.csdnimg.cn/public/common/toolbar/css/index.css">        <!--new top-->
    
      <!-- ad begin -->
         <script language="javascript" type="text/javascript" src="http://ads.csdn.net/js/tracking.js"></script>
    <!-- ad end-->

    <link rel="Stylesheet" type="text/css" href="http://static.blog.csdn.net/skin/skin-yellow/css/style.css?v=1.1" />
    <link id="RSSLink" title="RSS" type="application/rss+xml" rel="alternate" href="/qq_34413570/rss/list" />
    <link rel="shortcut icon" href="http://c.csdnimg.cn/public/favicon.ico" />
    <link type="text/css" rel="stylesheet" href="http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/default.css" />
 


<script>
        (function () {
            var bp = document.createElement('script');
            var curProtocol = window.location.protocol.split(':')[0];
            if (curProtocol === 'https') {
                bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
            }
            else {
                bp.src = 'http://push.zhanzhang.baidu.com/push.js';
            }
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(bp, s);
        })();
</script>


</head>
<body>


    <!-- 广告位开始 -->
        <ins data-revive-zoneid="149" data-revive-id="8c38e720de1c90a6f6ff52f3f89c4d57"></ins>
    <!-- 广告位结束 -->

    
   
      <!--new top-->
    <script id="toolbar-tpl-scriptId" fixed="true" prod="blog" skin="black" src="http://c.csdnimg.cn/public/common/toolbar/js/html.js" type="text/javascript"></script>
     <!--new top-->
    <div id="container">
        <div id="header">
    <div class="header">
        <div id="blog_title">
            <h2>
                <a href="http://blog.csdn.net/qq_34413570">低调如我的博客</a></h2>
            <h3></h3>
            <div class="clear">
            </div>
        </div>
        <div class="clear">
        </div>
        
     
    </div>
</div>
<div id="navigator">
    <div class="navigator_bg">
    </div>
    <div class="navigator">
        <ul>           
                <li id="btnContents"><a href="http://blog.csdn.net/qq_34413570?viewmode=contents"><span onclick="_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_mulu'])">
                    <img src="http://static.blog.csdn.net/images/ico_list.gif">目录视图</span></a></li>
                <li id="btnView"><a href="http://blog.csdn.net/qq_34413570?viewmode=list"><span onclick="_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_zhaiyao'])">
                    <img src="http://static.blog.csdn.net/images/ico_summary.gif">摘要视图</span></a></li>
                <li id="btnRss"><a href="http://blog.csdn.net/qq_34413570/rss/list"><span onclick="_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_RSS'])">
                    <img src="http://static.blog.csdn.net/images/ico_rss.gif">订阅</span></a></li>                
            

            </ul>
    </div>
</div>
<script type="text/javascript">
    var username = "qq_34413570";
    var _blogger = username;
    var blog_address = "http://blog.csdn.net/qq_34413570";
    var static_host = "http://static.blog.csdn.net";
    var currentUserName = "";  
</script>

        <div id="body">
            <div id="main">
                <div class="main">
                        <div class="ad_class">
<div class="notice tracking-ad" data-mod='popu_3' > 


<a href="http://blog.csdn.net/csdnproduct/article/details/70145129">
<font color=blue><strong>【公告】关于开启用户注册及登录手机短信验证的通知</strong></font></a>

&nbsp;&nbsp;&nbsp;&nbsp

<a href="http://blog.csdn.net/blogdevteam/article/details/70232533">
<font color=red> CSDN日报20170418 ——《如果两个程序员差不多，选写作能力更好的那个》 
</font></a>
&nbsp;&nbsp;&nbsp;&nbsp

<a href="http://blog.csdn.net/turingbooks/article/details/70237883">
<font color=blue><strong>程序员4月书讯：Angular来了！</strong>
</font></a>
</div>                        </div>
                        



  
<link href="http://static.blog.csdn.net/css/comment1.css" type="text/css" rel="stylesheet" />
<link href="http://static.blog.csdn.net/css/style1.css" type="text/css" rel="stylesheet" />
<script language='JavaScript' type='text/javascript' src='http://download.csdn.net/js/jquery.cookie.js'></script>
<script type="text/javascript" src="http://c.csdnimg.cn/rabbit/search-service/main.js"></script>
<link rel="stylesheet" href="http://static.blog.csdn.net/public/res-min/markdown_views.css?v=1.0" />
<link rel="stylesheet" href="http://static.blog.csdn.net/css/category.css?v=1.0" />
<script type="text/javascript" src="http://static.blog.csdn.net/public/res/bower-libs/MathJax/MathJax.js?config=TeX-AMS_HTML"></script>
<script type="text/javascript" src="http://static.blog.csdn.net/scripts/web-storage-cache.min.js"></script>
<script type="text/javascript" src="http://static.blog.csdn.net/scripts/replace.min.js"></script>

<link rel="stylesheet" href="http://static.blog.csdn.net/code/prettify.css" />
<script type="text/javascript" src="http://static.blog.csdn.net/code/prettify.js"></script>


  <script type="text/ecmascript">
      window.quickReplyflag = true;
           
            var isBole = false;
            
      
      var fasrc="http://my.csdn.net/my/favorite/miniadd?t=%e5%8e%9f%e5%88%9bspringmvc%2bspring3%2bhibernate4%e6%a1%86%e6%9e%b6%e6%95%b4%e5%90%88%2c%e5%ae%9e%e7%8e%b0%e5%a2%9e%e5%88%a0%e6%94%b9%e6%9f%a5%e5%8a%9f%e8%83%bd&u=http://blog.csdn.net/qq_34413570/article/details/51373884"

    </script>
<div id="article_details" class="details">
    <div class="article_title">   
         <span class="ico ico_type_Original"></span>


    <h1>
        <span class="link_title"><a href="/qq_34413570/article/details/51373884">
        <font color="red">[置顶]</font>
        原创springmvc+spring3+hibernate4框架整合,实现增删改查功能            
        </a></span>
    </h1>
</div>

   

        <div class="article_manage clearfix">
        <div class="article_l">
            <span class="link_categories">
            标签：
              <a href='http://www.csdn.net/tag/hibernate4' target=_blank onclick="_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_tag']);">hibernate4</a><a href='http://www.csdn.net/tag/spring3' target=_blank onclick="_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_tag']);">spring3</a><a href='http://www.csdn.net/tag/springmvc' target=_blank onclick="_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_tag']);">springmvc</a><a href='http://www.csdn.net/tag/%e6%a1%86%e6%9e%b6%e6%95%b4%e5%90%88' target=_blank onclick="_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_tag']);">框架整合</a><a href='http://www.csdn.net/tag/%e6%9e%b6%e6%9e%84' target=_blank onclick="_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_tag']);">架构</a>
            </span>
        </div>
        <div class="article_r">
            <span class="link_postdate">2016-05-11 13:43</span>
            <span class="link_view" title="阅读次数">12945人阅读</span>
            <span class="link_comments" title="评论次数"> <a href="#comments" onclick="_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_pinglun'])">评论</a>(5)</span>
            <span class="link_collect tracking-ad" data-mod="popu_171"> <a href="javascript:void(0);" onclick="javascript:collectArticle('%e5%8e%9f%e5%88%9bspringmvc%2bspring3%2bhibernate4%e6%a1%86%e6%9e%b6%e6%95%b4%e5%90%88%2c%e5%ae%9e%e7%8e%b0%e5%a2%9e%e5%88%a0%e6%94%b9%e6%9f%a5%e5%8a%9f%e8%83%bd','51373884');return false;" title="收藏">收藏</a></span>
             <span class="link_report"> <a href="#report" onclick="javascript:report(51373884,2);return false;" title="举报">举报</a></span>

        </div>
    </div>
    <div class="embody"  style="display:none" id="embody">
        <span class="embody_t">本文章已收录于：</span>
        <div class="embody_c" id="lib" value="{&quot;err&quot;:0,&quot;msg&quot;:&quot;ok&quot;,&quot;data&quot;:[]}"></div>
    </div>
    <style type="text/css">        
            .embody{
                padding:10px 10px 10px;
                margin:0 -20px;
                border-bottom:solid 1px #ededed;                
            }
            .embody_b{
                margin:0 ;
                padding:10px 0;
            }
            .embody .embody_t,.embody .embody_c{
                display: inline-block;
                margin-right:10px;
            }
            .embody_t{
                font-size: 12px;
                color:#999;
            }
            .embody_c{
                font-size: 12px;
            }
            .embody_c img,.embody_c em{
                display: inline-block;
                vertical-align: middle;               
            }
             .embody_c img{               
                width:30px;
                height:30px;
            }
            .embody_c em{
                margin: 0 20px 0 10px;
                color:#333;
                font-style: normal;
            }
    </style>
    <script  type="text/javascript">
        $(function () {
            try
            {
                var lib = eval("("+$("#lib").attr("value")+")");
                var html = "";
                if (lib.err == 0) {
                    $.each(lib.data, function (i) {
                        var obj = lib.data[i];
                        //html += '<img src="' + obj.logo + '"/>' + obj.name + "&nbsp;&nbsp;";
                        html += ' <a href="' + obj.url + '" target="_blank">';
                        html += ' <img src="' + obj.logo + '">';
                        html += ' <em><b>' + obj.name + '</b></em>';
                        html += ' </a>';
                    });
                    if (html != "") {
                        setTimeout(function () {
                            $("#lib").html(html);                      
                            $("#embody").show();
                        }, 100);
                    }
                }      
            } catch (err)
            { }
            
        });
    </script>
    <script   type="text/javascript" src="http://static.blog.csdn.net/scripts/category.js"></script>  
        <div   class="bog_copyright">         
            <p  class="copyright_p" >版权声明：本文为博主原创文章，未经博主允许不得转载。</p>
        </div>

  

  
  
     

<div id="article_content" class="article_content">

<h1>项目开发环境</h1>
<h3>1.Eclipse</h3>
<h3>2.tomcat7.0</h3>
<h3>3.MySQL</h3>
<h1>项目的整体架构</h1>
<p><img src="http://img.blog.csdn.net/20160511151759457?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt=""><br>
</p>
<h1>所用到的jar包<br>
</h1>
<p><img src="http://img.blog.csdn.net/20160511151647237?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" height="444" width="399"></p>
<p><img src="http://img.blog.csdn.net/20160511153017645?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt=""></p>
<h1>数据库表</h1>
<h3>数据库表就不用教大家了,一张表,很简单的,下面是我建好的表<br>
</h3>
<p><img src="http://img.blog.csdn.net/20160511151855333?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt=""></p>
<p><br>
</p>
<h3>下面是web.xml的详情信息<br>
</h3>
<p></p>
<pre name="code" class="html">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;web-app xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;  xmlns:web=&quot;http://java.sun.com/xml/ns/javaee&quot; xmlns=&quot;http://java.sun.com/xml/ns/javaee&quot; xsi:schemaLocation=&quot;http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd&quot; id=&quot;WebApp_ID&quot; version=&quot;2.5&quot;&gt;
  &lt;display-name&gt;json_test&lt;/display-name&gt;
  &lt;welcome-file-list&gt;
    &lt;welcome-file&gt;login.jsp&lt;/welcome-file&gt;
  &lt;/welcome-file-list&gt;
  &lt;context-param&gt;
    &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
    &lt;param-value&gt;classpath:spring/spring-*.xml&lt;/param-value&gt;
  &lt;/context-param&gt;
  &lt;listener&gt;
    &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
  &lt;/listener&gt;
  &lt;listener&gt;
    &lt;listener-class&gt;org.springframework.web.util.IntrospectorCleanupListener&lt;/listener-class&gt;
  &lt;/listener&gt;
  &lt;servlet&gt;
    &lt;servlet-name&gt;springMVC&lt;/servlet-name&gt;
    &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
    &lt;init-param&gt;
      &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
      &lt;param-value&gt;classpath:spring/spring-mvc.xml&lt;/param-value&gt;
    &lt;/init-param&gt;
    &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
    &lt;servlet-name&gt;springMVC&lt;/servlet-name&gt;
    &lt;url-pattern&gt;*.do&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  &lt;filter&gt;
    &lt;filter-name&gt;encodingFilter&lt;/filter-name&gt;
    &lt;filter-class&gt;org.springframework.web.filter.CharacterEncodingFilter&lt;/filter-class&gt;
    &lt;init-param&gt;
      &lt;param-name&gt;encoding&lt;/param-name&gt;
      &lt;param-value&gt;UTF-8&lt;/param-value&gt;
    &lt;/init-param&gt;
    &lt;init-param&gt;
      &lt;param-name&gt;forceEncoding&lt;/param-name&gt;
      &lt;param-value&gt;true&lt;/param-value&gt;
    &lt;/init-param&gt;
  &lt;/filter&gt;
  &lt;filter-mapping&gt;
    &lt;filter-name&gt;encodingFilter&lt;/filter-name&gt;
    &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  &lt;/filter-mapping&gt;
  &lt;filter&gt;
    &lt;filter-name&gt;openSession&lt;/filter-name&gt;
    &lt;filter-class&gt;org.springframework.orm.hibernate4.support.OpenSessionInViewFilter&lt;/filter-class&gt;
  &lt;/filter&gt;
  &lt;filter-mapping&gt;
    &lt;filter-name&gt;openSession&lt;/filter-name&gt;
    &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  &lt;/filter-mapping&gt;
&lt;/web-app&gt;</pre><br>
<p></p>
<h3>下面是spring-common.xml的详情信息</h3>
<p></p>
<pre name="code" class="html">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;beans xmlns=&quot;http://www.springframework.org/schema/beans&quot;
  xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
  xmlns:aop=&quot;http://www.springframework.org/schema/aop&quot;
  xmlns:cache=&quot;http://www.springframework.org/schema/cache&quot;
  xmlns:context=&quot;http://www.springframework.org/schema/context&quot;
  xmlns:jdbc=&quot;http://www.springframework.org/schema/jdbc&quot;
  xmlns:jee=&quot;http://www.springframework.org/schema/jee&quot;
  xmlns:jms=&quot;http://www.springframework.org/schema/jms&quot;
  xmlns:lang=&quot;http://www.springframework.org/schema/lang&quot;
  xmlns:mvc=&quot;http://www.springframework.org/schema/mvc&quot;
  xmlns:oxm=&quot;http://www.springframework.org/schema/oxm&quot;
  xmlns:task=&quot;http://www.springframework.org/schema/task&quot;
  xmlns:tx=&quot;http://www.springframework.org/schema/tx&quot;
  xmlns:util=&quot;http://www.springframework.org/schema/util&quot;
  xsi:schemaLocation=&quot;http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
    http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache-4.0.xsd
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
    http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-4.0.xsd
    http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-4.0.xsd
    http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms-4.0.xsd
    http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-4.0.xsd
    http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
    http://www.springframework.org/schema/oxm http://www.springframework.org/schema/oxm/spring-oxm-4.0.xsd
    http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-4.0.xsd
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
    http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.0.xsd&quot;&gt;
	
	&lt;!--扫描映射  --&gt;
	&lt;context:component-scan base-package=&quot;ssh&quot;/&gt;
	
	&lt;!-- 引入property配置文件 --&gt;
	&lt;context:property-placeholder location=&quot;classpath:prop/jdbc.properties&quot;/&gt;
		
	&lt;!-- 配置数据源 --&gt;
	&lt;bean id=&quot;dataSource&quot; class=&quot;org.springframework.jdbc.datasource.DriverManagerDataSource&quot; &gt;
		&lt;property name=&quot;driverClassName&quot; value=&quot;${jdbc.mysql.driverClassName}&quot;&gt;&lt;/property&gt;
		&lt;property name=&quot;url&quot; value=&quot;${jdbc.mysql.url}&quot;&gt;&lt;/property&gt;
		&lt;property name=&quot;username&quot; value=&quot;${jdbc.mysql.username}&quot;&gt;&lt;/property&gt;
		&lt;property name=&quot;password&quot; value=&quot;${jdbc.mysql.password}&quot;&gt;&lt;/property&gt;
		&lt;!-- 初始化连接大小
		&lt;property name=&quot;initialSize&quot; value=&quot;${jdbc.initialSize}&quot;&gt;&lt;/property&gt; --&gt;
		&lt;!-- 连接池最大数量 
		&lt;property name=&quot;maxActive&quot; value=&quot;${jdbc.maxActive}&quot;&gt;&lt;/property&gt;--&gt;
		&lt;!-- 连接池最大空闲 --&gt;
		&lt;!-- &lt;property name=&quot;maxIdle&quot; value=&quot;${maxIdle}&quot;&gt;&lt;/property&gt; --&gt;
		&lt;!-- 连接池最小空闲 
		&lt;property name=&quot;minIdle&quot; value=&quot;${jdbc.minIdle}&quot;&gt;&lt;/property&gt;--&gt;
		&lt;!-- 获取连接最大等待时间 
		&lt;property name=&quot;maxWait&quot; value=&quot;${jdbc.maxWait}&quot;&gt;&lt;/property&gt;--&gt;
	&lt;/bean&gt;
	
	&lt;!-- 配置SessionFactory --&gt;
	&lt;bean id=&quot;sessionFactory&quot; class=&quot;org.springframework.orm.hibernate4.LocalSessionFactoryBean&quot;&gt;
		&lt;property name=&quot;dataSource&quot; ref=&quot;dataSource&quot; /&gt;
		&lt;property name=&quot;hibernateProperties&quot;&gt;
			&lt;props&gt;
				&lt;prop key=&quot;hibernate.dialect&quot;&gt;${jdbc.mysql.dialect}&lt;/prop&gt;
				&lt;prop key=&quot;hibernate.hbm2ddl.auto&quot;&gt;update&lt;/prop&gt;
				&lt;!--是否显示sql语句 我在这里是显示的  --&gt;
				&lt;prop key=&quot;hibernate.show_sql&quot;&gt;true&lt;/prop&gt;
				&lt;!--格式化显示sql语句  --&gt;
				&lt;prop key=&quot;hibernate.format_sql&quot;&gt;true&lt;/prop&gt;
			&lt;/props&gt;
		&lt;/property&gt;
		&lt;!-- 自动扫描制定位置下的实体进行映射  --&gt; 
    	&lt;property name=&quot;packagesToScan&quot; value=&quot;ssh.entity&quot;/&gt;
	&lt;/bean&gt;
	
	&lt;!-- 配置一个事务管理器 --&gt;
	&lt;bean id=&quot;transactionManager&quot; class=&quot;org.springframework.orm.hibernate4.HibernateTransactionManager&quot;&gt;
		&lt;property name=&quot;sessionFactory&quot; ref=&quot;sessionFactory&quot;/&gt;
	&lt;/bean&gt;
	
	&lt;!-- 应该是开启事物 --&gt;
	&lt;tx:annotation-driven transaction-manager=&quot;transactionManager&quot;/&gt;
	
&lt;/beans&gt;</pre><br>
<p></p>
<h3>下面是spring-mvc.xml的详情信息<br>
</h3>
<p></p>
<pre name="code" class="html">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;beans xmlns=&quot;http://www.springframework.org/schema/beans&quot;
	xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
	xmlns:context=&quot;http://www.springframework.org/schema/context&quot;
	xmlns:mvc=&quot;http://www.springframework.org/schema/mvc&quot;
	xsi:schemaLocation=&quot;http://www.springframework.org/schema/beans 
	http://www.springframework.org/schema/beans/spring-beans.xsd
	http://www.springframework.org/schema/context
	http://www.springframework.org/schema/context/spring-context-3.2.xsd
	http://www.springframework.org/schema/mvc
	http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd&quot;&gt;
	
	&lt;!-- 注解扫描包 --&gt;
	&lt;context:component-scan base-package=&quot;ssh&quot; /&gt;

	&lt;!-- 开启注解 --&gt;
	&lt;mvc:annotation-driven /&gt;		

	&lt;!-- 定义视图解析器 --&gt;	
	&lt;bean id=&quot;viewResolver&quot; class=&quot;org.springframework.web.servlet.view.InternalResourceViewResolver&quot;&gt;
		&lt;property name=&quot;prefix&quot; value=&quot;/&quot;&gt;&lt;/property&gt;
		&lt;property name=&quot;suffix&quot; value=&quot;.jsp&quot;&gt;&lt;/property&gt;
	&lt;/bean&gt;
&lt;/beans&gt;
</pre>
<p></p>
<p><br>
</p>
<h3>Hibernate用于连接数据库的小配置文件jdbc.properties的详情信息<br>
</h3>
<p></p>
<pre name="code" class="html"># JDBC
# 设置连接池连接时的数量
jdbc.initialSize=1
jdbc.filters=stat
# 连接池中存在的最小连接数目。连接池中连接数目可以变很少，如果使用了maxAge属性，有些空闲的连接会被关闭因为离它最近一次连接的时间过去太久了。但是，我们看到的打开的连接不会少于minIdle。
jdbc.minIdle=1
# 连接数据库的最大连接数。这个属性用来限制连接池中能够打开连接的数量，可以方便数据库做连接容量规划。
jdbc.maxActive=99
jdbc.maxWait=1000
jdbc.minEvictableIdleTimeMillis=300000
jdbc.poolPreparedStatements=true
jdbc.maxPoolPreparedStatementPerConnectionSize=50
jdbc.timeBetweenEvictionRunsMillis=60000
jdbc.validationQuery=select 1 from dual

jdbc.removeAbandonedTimeout=150  
jdbc.logAbandoned=true
jdbc.removeAbandoned=true
jdbc.testOnBorrow=false
jdbc.testOnReturn=false


#ORACLE 数据库连接方式
#jdbc.oracle.driverClassName=oracle.jdbc.driver.OracleDriver
#jdbc.oracle.url=jdbc\:oracle\:thin\:@localhost\:1521\:orcl
#jdbc.oracle.username=wrg
#jdbc.oracle.password=wrg
#jdbc.oracle.dialect=org.hibernate.dialect.Oracle10gDialect



# MYSQL 数据库连接方式
jdbc.mysql.driverClassName=com.mysql.jdbc.Driver
jdbc.mysql.url=jdbc:mysql://localhost:3806/springmvc?characterEncoding=UTF-8
jdbc.mysql.username=root
jdbc.mysql.password=HZIMS_GP
jdbc.mysql.dialect=org.hibernate.dialect.MySQL5InnoDBDialect


#HIBERNATE
jdbc.show_sql=false
jdbc.format_sql=false


</pre>
<p></p>
<h3>下面是log4j.properties日志文件的详情信息<br>
</h3>
<p></p>
<pre name="code" class="html">#console log
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} [%t] %-5p %c - %m%n


#logger
log4j.logger.org.springframework=DEBUG,CONSOLE
log4j.logger.org.hibernate=INFO,CONSOLE
log4j.logger.org.apache=INFO,CONSOLE



log4j.rootLogger=DEBUG,CONSOLE</pre><br>
<p></p>
<h3>创建Entity类User实体</h3>
<p></p>
<pre name="code" class="html">package ssh.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
@Entity
@Table(name=&quot;TUSER&quot;)
public class User{	
	@Id
	@GeneratedValue(generator=&quot;id&quot;)
	@GenericGenerator(name = &quot;id&quot;,strategy=&quot;identity&quot;)
	private Integer id;
	private String name;
	private String password;	
	@Column(name=&quot;LOGIN_DATE&quot;)
	private String loginDate;
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getLoginDate() {
		return loginDate;
	}
	public void setLoginDate(String loginDate) {
		this.loginDate = loginDate;
	}
	@Override
	public String toString() {
		return &quot;User [id=&quot; + id + &quot;, name=&quot; + name + &quot;, password=&quot; + password
				+ &quot;, loginDate=&quot; + loginDate + &quot;]&quot;;
	}
	
}
</pre>
<p></p>
<p><br>
</p>
<h3>创建Dao层接口</h3>
<p></p>
<pre name="code" class="html">package ssh.dao;
import java.util.List;
import ssh.entity.User;
public interface UserDao {
	//登录
	User selectUser(User user) throws Exception;
	//查询所有
	List&lt;User&gt; getAllUsers() throws Exception;
	//添加用户
	void addUser(User user) throws Exception;
	//删除用户
	void delUser(Integer id) throws Exception;
	//修改用户
	void updateUser(User user) throws Exception;
	//单个查询
	User getUser(Integer id) throws Exception ;
}
</pre><br>
<br>
<p></p>
<h3>Dao层接口的实现</h3>
<p></p>
<pre name="code" class="html">package ssh.dao;
import java.util.List;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import ssh.entity.User;
@Repository
@SuppressWarnings(&quot;unchecked&quot;)
public class UserDaoImpl implements UserDao {
	@Autowired
	private SessionFactory sessionFactory;
	//登录
	public User selectUser(User user) throws Exception {
		Query query = sessionFactory.getCurrentSession().createQuery(&quot;from User u where u.name=? and u.password=?&quot;);
		query.setString(0, user.getName());
		query.setString(1, user.getPassword());
		List&lt;User&gt; list = query.list();
		if(list==null||list.size()==0){
			throw new RuntimeException(&quot;查询失败&quot;);
		}
		return list.get(0);
	}
	
	//查询所有
	public List&lt;User&gt; getAllUsers() throws Exception {
		Query query = sessionFactory.getCurrentSession().createQuery(&quot;from User&quot;);
		List&lt;User&gt; list = query.list();
		return list;
	}
	
	//单个查询
	public User getUser(Integer id) throws Exception {
		return (User) sessionFactory.getCurrentSession().createQuery(&quot;from User u where u.id =&quot;+id).uniqueResult();
	}

	//添加用户
	public void addUser(User user) throws Exception {
		System.out.println(&quot;11111111111111111&quot;+user.getName());
		sessionFactory.getCurrentSession().save(user);
	}
	
	//删除用户
	public void delUser(Integer id) throws Exception {
		sessionFactory.getCurrentSession().createQuery(&quot;delete User u where u.id=&quot;+id).executeUpdate();	   	
		
	}
	
	//修改用户
	public void updateUser(User user) throws Exception {
		 Session session = sessionFactory.getCurrentSession();
		 session.beginTransaction();
		 String hql = (&quot;update User u set u.name = ?,u.password = ?,u.loginDate = ? where u.id = ?&quot;);  
		 Query query = session.createQuery(hql);
		 query.setParameter(0, user.getName());
		 query.setParameter(1, user.getPassword());
		 query.setParameter(2, user.getLoginDate());
		 query.setParameter(3, user.getId());
		 query.executeUpdate();
		 session.getTransaction().commit(); 			
	}
}
</pre>
<p></p>
<h3>创建Service层的接口</h3>
<pre name="code" class="html">package ssh.service;
import java.util.List;
import ssh.entity.User;
public interface UserService {
	//登录
	User selectUser(User user ) throws Exception;
	//查询所有
	List&lt;User&gt; getAllUsers() throws Exception;
	//添加用户
	void addUser(User user) throws Exception;
	//删除用户
	void delUser(Integer id) throws Exception;	
	//修改用户
	void updateUser(User user) throws Exception;	
	//单个查询
	User getUser(Integer id) throws Exception;
}
</pre><br>
<h3>Service层的接口的实现</h3>
<p></p>
<pre name="code" class="html">package ssh.service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import ssh.dao.UserDao;
import ssh.entity.User;
@Service(&quot;userService&quot;)
public class UserServiceImpl implements UserService{
	@Autowired
	private UserDao userDao;
	//登录
	public User selectUser(User user) throws Exception {
		return userDao.selectUser(user);
	}
	
	//单个查询
	public User getUser(Integer id) throws Exception {
		return userDao.getUser(id);			
	}  
	//查询所有
	public List&lt;User&gt; getAllUsers() throws Exception {
		List&lt;User&gt; users = userDao.getAllUsers();		
		return users;
	}
	
	//添加用户
	public void addUser(User user) throws Exception {
		userDao.addUser(user);	
	}
	//删除用户
	
	public void delUser(Integer id) throws Exception {		 
		userDao.delUser(id);
	}
	//修改用户
	public void updateUser(User user) throws Exception {
		userDao.updateUser(user);		
	}  	
}
</pre><br>
<p></p>
<h3>控制层Action层的代码如下</h3>
<p></p>
<pre name="code" class="html">package ssh.action;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import ssh.entity.User;
import ssh.path.Path;
import ssh.service.UserService;
@Controller
@RequestMapping(value=Path.USER)
public class UserAction {	
	@Autowired
	private UserService userService;
	@RequestMapping(value=Path.LOGIN_INDEX)
	public String login(HttpServletRequest request, HttpServletResponse response) throws Exception{
		return Path.LOGIN_INDEX;
	}
		
	@RequestMapping(value=Path.LOGIN_OK,method=RequestMethod.POST)
	public String loginCheck(User user,HttpServletRequest request, HttpServletResponse response) throws Exception{
		response.setContentType(&quot;text/html;charset=utf-8&quot;);
		User u = userService.selectUser(user);
		System.out.println(&quot;user is ------------------------ &quot;+u);
		request.setAttribute(&quot;user&quot;, u);
		return &quot;redirect:/user/index.do&quot;;
		}
	
	//单个查询
	@RequestMapping(value=Path.GET_USER)  
	public String getUser(Integer id,HttpServletRequest request) throws Exception{  
	    request.setAttribute(&quot;user&quot;, userService.getUser(id));  
	    return Path.UPDATE_USER;  
	} 
	
	//查询所有
	@RequestMapping(value=Path.INDEX)
	public String getAllUsers(HttpServletRequest request) throws Exception{
		request.setAttribute(&quot;userList&quot;, userService.getAllUsers());
		return Path.INDEX;
	}
	//添加跳转方法
	@RequestMapping(value=Path.TO_ADDUSER)  
	public String toAddUser(){  
	    return Path.ADD_USER;  
	}		
	//添加用户
	@RequestMapping(value=Path.ADD_USER)
	public String addUser(User user,HttpServletRequest request) throws Exception{
		System.out.println(&quot;用户名：======&quot;+user.getName());
		userService.addUser(user);
		return &quot;redirect:/user/index.do&quot;;
	}
	
	//删除用户
	@RequestMapping(value=Path.DEL_USER)
	public String delUser(Integer id,HttpServletResponse response) throws Exception{  
	    userService.delUser(id);
	    return &quot;redirect:/user/index.do&quot;;
	}  
	
	//更新用户
	@RequestMapping(value=Path.UPDATE_USER)
	public String  updateUser(User user,HttpServletRequest request) throws Exception{
		
		userService.updateUser(user);
		user = userService .getUser(user.getId());
		request.setAttribute(&quot;user&quot;, user);		
		return &quot;redirect:/user/index.do&quot;;
		
	}					
}
</pre><br>
<p></p>
<h3>全局路径Path的代码</h3>
<p></p>
<pre name="code" class="html">package ssh.path;
public class Path {
	public static final String USER = &quot;/user&quot;;
	/**
	 * 登陆
	 */
	public static final String LOGIN_INDEX = &quot;/login&quot;;
	/**
	 * 登陆成功
	 */
	public static final String LOGIN_OK = &quot;/loginok&quot;;
	
	/**
	 * 查询所有
	 */
	public static final String INDEX = &quot;/index&quot;;
	/**
	 * 添加用户
	 */
	public static final String ADD_USER = &quot;/addUser&quot;;
	
	/**
	 * 跳转添加用户
	 */
	public static final String TO_ADDUSER = &quot;/toaddUser&quot;;
	
	/**
	 * 删除用户
	 */
	public static final String DEL_USER = &quot;/delUser&quot;;
	
	/**
	 * 更新用户
	 */
	public static final String UPDATE_USER = &quot;/updateUser&quot;;
	
	/**
	 * 跳转更新用户
	 */
	public static final String GET_USER = &quot;/getUser&quot;;		
}
</pre><br>
<p></p>
<h3>测试类Test的代码</h3>
<p></p>
<pre name="code" class="html">package ssh.test;
import org.hibernate.SessionFactory;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;
import ssh.dao.UserDao;
import ssh.entity.User;
import ssh.service.UserService;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations=&quot;classpath:spring/spring-common.xml&quot;)
@Transactional
/**
 * 
 * @author hello
 *	说明：在这里 所有实例化的注解我都使用 @Autowrited (spring通用的)
 *						      也可以使用 @Resource   (J2EE通用的)
 *						      两者区别百度
 */
public class TestAll {
	@Autowired
	private SessionFactory sessionFactory;
	/**
	 * 测试sessionfactory
	 * 测试时 spring-common 不能存在 事物bean
	 * 					      不能存在 事物管理器 bean
	 * 					      不能存在dao
	 * 					      不能存在service
	 * 					      不能存在action
	 * 只是为了防止当其他内容写错时 sessionfactory也开启不了 除非是其他的bean没有错
	 */
	@Test
	public void testSf(){
		System.out.println(&quot;测试开启&quot;);
		System.out.println(&quot;   sessionfactory = &quot;+sessionFactory);
		System.out.println(&quot;测试完成&quot;);
	}
	/**
	 * 测试UserDao
	 */
	@Autowired
	private UserDao userDao;
	@Test
	public void testUserDao() throws Exception{
		User u = new User();
		u.setName(&quot;admin&quot;);
		u.setPassword(&quot;12345678&quot;);
		User user  = userDao.selectUser(u);
		System.out.println(&quot;user is &quot;+user);
		userDao.addUser(u);
	}					
	/**
	 * 测试UserService
	 */
	@Autowired
	private UserService userService;
	@Test
	public void testUserService() throws Exception{
		User u = new User();
		u.setName(&quot;admin&quot;);
		u.setPassword(&quot;12345678&quot;);
		User user = userService.selectUser(u);
		System.out.println(&quot;user is &quot;+user);
	}
}
</pre>
<p></p>
<h3>登录界面login.jsp的代码</h3>
<p></p>
<pre name="code" class="html">&lt;%@ page language=&quot;java&quot; import=&quot;java.util.*&quot; contentType=&quot;text/html; charset=utf-8&quot; pageEncoding=&quot;utf-8&quot;%&gt;
&lt;%
String path = request.getContextPath();
String basePath = request.getScheme()+&quot;://&quot;+request.getServerName()+&quot;:&quot;+request.getServerPort()+path+&quot;/&quot;;
%&gt;

&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;&gt;
&lt;html&gt;
  &lt;script type=&quot;text/javascript&quot; src=&quot;../js/jquery-1.8.3.js&quot;&gt;&lt;/script&gt;
&lt;style&gt; 
body{ text-align:center} 
.div{ margin:0 auto; width:800px; height:500px; border:1px solid #F00} 
/* css注释：为了观察效果设置宽度 边框 高度等样式 */ 
&lt;/style&gt; 
  &lt;body&gt;
  &lt;div class=&quot;div&quot;&gt;
  &lt;h1&gt;用户登录&lt;/h1&gt;
    &lt;form action=&quot;/spring_springmvc_hibernate/user/index.do&quot; method=&quot;post&quot;&gt;
    	用户名：&lt;input  type=&quot;text&quot; name=&quot;name&quot; &gt;
    	密码：&lt;input  type=&quot;password&quot; name=&quot;password&quot;&gt;
    	&lt;input type=&quot;submit&quot; value=&quot;提交&quot; &gt;
    &lt;/form&gt;
    &lt;/div&gt;
  &lt;/body&gt;
&lt;/html&gt;
</pre><br>
<p></p>
<h3>查询所有index.jsp页面的代码</h3>
<p></p>
<pre name="code" class="html">&lt;%@ page language=&quot;java&quot; contentType=&quot;text/html; charset=UTF-8&quot;  
pageEncoding=&quot;UTF-8&quot;%&gt;  
&lt;%@taglib prefix=&quot;c&quot; uri=&quot;http://java.sun.com/jsp/jstl/core&quot;%&gt;
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot; &quot;http://www.w3.org/TR/html4/loose.dtd&quot;&gt;  
&lt;html&gt;  
&lt;head&gt;
&lt;%
    String path = request.getContextPath();
%&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;&lt;%=path%&gt;/js/jquery-1.9.1.min.js&quot;&gt;&lt;/script&gt;  
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot;&gt;  
&lt;title&gt;Insert title here&lt;/title&gt; 
&lt;style&gt; 
body{ text-align:center} 
.div{ margin:0 auto; width:800px; height:500px; border:1px solid #F00} 
/* css注释：为了观察效果设置宽度 边框 高度等样式 */ 
.t{ margin:0 auto; width:600px; height:300px; border:1px solid #F00} 

&lt;/style&gt; 

&lt;/head&gt;  
&lt;body&gt; 
&lt;div class=&quot;div&quot;&gt;   
    &lt;h1&gt;&lt;a href=&quot;/spring_springmvc_hibernate/user/toaddUser.do&quot;&gt;添加用户&lt;/a&gt;&lt;/h1&gt;  
    &lt;table border=&quot;1&quot; class=&quot;t&quot;&gt;  
        &lt;tbody&gt;  
        &lt;tr&gt;  
            &lt;th&gt;姓名&lt;/th&gt;  
            &lt;th&gt;密码&lt;/th&gt;  
            &lt;th&gt;登录时间&lt;/th&gt;
            &lt;th&gt;操作&lt;/th&gt;    
        &lt;/tr&gt;  
        &lt;c:if test=&quot;${!empty userList }&quot;&gt;  
            &lt;c:forEach items=&quot;${userList}&quot; var=&quot;user&quot;&gt;  
                &lt;tr&gt;  
                	&lt;td&gt;${user.name }&lt;/td&gt; 
                    &lt;td&gt;${user.password }&lt;/td&gt;  
                    &lt;td&gt;${user.loginDate }&lt;/td&gt;  
                    &lt;td&gt;  
                        &lt;a href=&quot;/spring_springmvc_hibernate/user/getUser.do?id=${user.id }&quot;&gt;编辑&lt;/a&gt;  
                        &lt;a href=&quot;/spring_springmvc_hibernate/user/delUser.do?id=${user.id }&quot;&gt;删除&lt;/a&gt;  
                    &lt;/td&gt;  
                &lt;/tr&gt;               
            &lt;/c:forEach&gt;  
        &lt;/c:if&gt;  
    &lt;/tbody&gt; 
   &lt;/div&gt;   
&lt;/table&gt;  
&lt;/body&gt;  
&lt;/html&gt;  </pre><br>
<p></p>
<h3>添加用户addUser.jsp的页面代码</h3>
<p></p>
<pre name="code" class="html">&lt;%@ page language=&quot;java&quot; contentType=&quot;text/html; charset=UTF-8&quot;  
pageEncoding=&quot;UTF-8&quot;%&gt;
&lt;%@taglib prefix=&quot;c&quot; uri=&quot;http://java.sun.com/jsp/jstl/core&quot;%&gt;  
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot; &quot;http://www.w3.org/TR/html4/loose.dtd&quot;&gt;  
&lt;html&gt;  
&lt;head&gt;  
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot;&gt;  
&lt;title&gt;Insert title here&lt;/title&gt;  
&lt;style&gt; 
body{ text-align:center} 
.div{ margin:0 auto; width:800px; height:500px; border:1px solid #F00} 
/* css注释：为了观察效果设置宽度 边框 高度等样式 */ 
&lt;/style&gt; 
&lt;script type=&quot;text/javascript&quot;&gt;  
function addUser(){  
    var form = document.forms[0];  
    form.action = &quot;/spring_springmvc_hibernate/user/addUser.do&quot;;  
    form.method=&quot;post&quot;;  
    form.submit();  
}  
&lt;/script&gt;  
&lt;/head&gt;  
&lt;body&gt; 
&lt;div class=&quot;div&quot;&gt;  
&lt;h1&gt;添加用户&lt;/h1&gt;  
&lt;form action=&quot;&quot; name=&quot;userForm&quot;&gt; 

    姓名：&lt;input type=&quot;text&quot; name=&quot;name&quot;&gt; 
    密码：&lt;input type=&quot;text&quot; name=&quot;password&quot;&gt; 
    时间：&lt;input type=&quot;text&quot; name=&quot;loginDate&quot;&gt;  
    &lt;input type=&quot;button&quot; value=&quot;添加&quot; onclick=&quot;addUser()&quot;&gt;  
&lt;/form&gt; 
&lt;/div&gt; 
&lt;/body&gt;  
&lt;/html&gt;  </pre>
<p></p>
<h3>更新数据updateUser.jsp的页面代码</h3>
<p></p>
<pre name="code" class="html">&lt;%@ page language=&quot;java&quot; contentType=&quot;text/html; charset=UTF-8&quot;  
pageEncoding=&quot;UTF-8&quot;%&gt;
&lt;%@taglib prefix=&quot;c&quot; uri=&quot;http://java.sun.com/jsp/jstl/core&quot;%&gt;  
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot; &quot;http://www.w3.org/TR/html4/loose.dtd&quot;&gt;  
&lt;html&gt;  
&lt;head&gt;
&lt;%
String path = request.getContextPath();
%&gt;  
&lt;script type=&quot;text/javascript&quot; src=&quot;&lt;%=path %&gt;/js/jquery-1.9.1.min.js&quot;&gt;&lt;/script&gt;  
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot;&gt;  
&lt;title&gt;Insert title here&lt;/title&gt;
&lt;style&gt; 
body{ text-align:center} 
.div{ margin:0 auto; width:800px; height:500px; border:1px solid #F00} 
/* css注释：为了观察效果设置宽度 边框 高度等样式 */ 
&lt;/style&gt;   
&lt;/head&gt;  
&lt;body&gt; 
&lt;div class=&quot;div&quot;&gt;   
&lt;h1&gt;编辑用户&lt;/h1&gt;  
&lt;form action=&quot;/spring_springmvc_hibernate/user/updateUser.do&quot; name=&quot;userForm&quot; method=&quot;post&quot;&gt;  
  &lt;input type=&quot;hidden&quot; name=&quot;id&quot; value=&quot;${user.id }&quot;&gt;  
    姓名：&lt;input type=&quot;text&quot; name=&quot;name&quot; value=&quot;${user.name }&quot;&gt;  
    密码：&lt;input type=&quot;text&quot; name=&quot;password&quot; value=&quot;${user.password }&quot;&gt;  
    时间：&lt;input type=&quot;text&quot; name=&quot;loginDate&quot; value=&quot;${user.loginDate }&quot;&gt; 
    &lt;input type=&quot;submit&quot; value=&quot;编辑&quot; &gt;  
&lt;/form&gt;
&lt;/div&gt;    
&lt;/body&gt;  
&lt;/html&gt; </pre>
<p></p>
<h2 align="center">用户登录界面</h2>
<p align="center"><img src="http://img.blog.csdn.net/20160511151953146?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt=""></p>
<p align="center"></p>
<h2 align="center">查询所有界面</h2>
<p></p>
<h2 align="center"><img src="http://img.blog.csdn.net/20160511152038335?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt=""><br>
</h2>
<h2 align="center">编辑用户页面</h2>
<p align="center"><img src="http://img.blog.csdn.net/20160511152123963?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt=""></p>
<h2 align="center">添加用户页面</h2>
<p align="center"><img src="http://img.blog.csdn.net/20160511152152292?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt=""></p>
<h3 align="center">删除就不说了,点击删除自动回到查询所有的界面</h3>
<h3 align="center">以上就是所有关于三大框架整合的所有代码</h3>
<p><br>
</p>
<p></p>
<h2 align="center">项目源码下载:http://download.csdn.net/detail/qq_34413570/9516908</h2>
<p></p>
<br>
   
</div>




<!-- Baidu Button BEGIN -->




<div class="bdsharebuttonbox tracking-ad" style="float: right;" data-mod="popu_172">
<a href="#" class="bds_more" data-cmd="more" style="background-position:0 0 !important; background-image: url(http://bdimg.share.baidu.com/static/api/img/share/icons_0_16.png?v=d754dcc0.png) !important"></a>
<a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"  style="background-position:0 -52px !important"></a>
<a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"style="background-position:0 -104px !important"></a>
<a href="#" class="bds_tqq" data-cmd="tqq" title="分享到腾讯微博"style="background-position:0 -260px !important"></a>
<a href="#" class="bds_renren" data-cmd="renren" title="分享到人人网"style="background-position:0 -208px !important"></a>
<a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信"style="background-position:0 -1612px !important" ></a>
</div>
<script>window._bd_share_config = { "common": { "bdSnsKey": {}, "bdText": "", "bdMini": "1", "bdMiniList": false, "bdPic": "", "bdStyle": "0", "bdSize": "16" }, "share": {} }; with (document) 0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).src = 'http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion=' + ~(-new Date() / 36e5)];</script>
<!-- Baidu Button END -->

   <link rel="stylesheet" href="http://static.blog.csdn.net/css/blog_detail.css" />

    
<!--172.16.140.13-->

<!-- Baidu Button BEGIN -->
<script type="text/javascript" id="bdshare_js" data="type=tools&amp;uid=1536434" ></script>
<script type="text/javascript" id="bdshell_js"></script>
<script type="text/javascript">
    document.getElementById("bdshell_js").src = "http://bdimg.share.baidu.com/static/js/shell_v2.js?cdnversion=" + Math.ceil(new Date()/3600000)
</script>
<!-- Baidu Button END -->

<script type="text/javascript">
    var fromjs = $("#fromjs");
    if (fromjs.length > 0) {
            $("#fromjs .markdown_views pre").addClass("prettyprint");
            prettyPrint();

            $('pre.prettyprint code').each(function () {
                var lines = $(this).text().split('\n').length;
                var $numbering = $('<ul/>').addClass('pre-numbering').hide();
                $(this).addClass('has-numbering').parent().append($numbering);
                for (i = 1; i <= lines; i++) {
                    $numbering.append($('<li/>').text(i));
                };
                $numbering.fadeIn(1700);
            });

            $('.pre-numbering li').css("color", "#999");
        }

    

</script>

 


        <div id="digg" ArticleId="51373884" >
            <dl id="btnDigg" class="digg digg_disable"  onclick="btndigga();">
               
                 <dt>顶</dt>
                <dd>2</dd>
            </dl>
           
              
            <dl id="btnBury" class="digg digg_disable"  onclick="btnburya();">
              
                  <dt>踩</dt>
                <dd>0</dd>               
            </dl>
            
        </div>
     <div class="tracking-ad" data-mod="popu_222"><a href="javascript:void(0);" >&nbsp;</a>   </div>
    <div class="tracking-ad" data-mod="popu_223"> <a href="javascript:void(0);" >&nbsp;</a></div>
    <script type="text/javascript">
                function btndigga() {
                    $(".tracking-ad[data-mod='popu_222'] a").click();
                }
                function btnburya() {
                    $(".tracking-ad[data-mod='popu_223'] a").click();
                }
            </script>

   <ul class="article_next_prev">
                <li class="next_article"><span onclick="_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_xiayipian']);location.href='/qq_34413570/article/details/52687552';">下一篇</span><a href="/qq_34413570/article/details/52687552" onclick="_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_xiayipian'])">后台传的json串页面生成树</a></li>
    </ul>

    <div style="clear:both; height:10px;"></div>


      
</div>

     <div>
             <ins data-revive-zoneid="206" data-revive-id="8c38e720de1c90a6f6ff52f3f89c4d57"></ins> 
    </div>

<div id="suggest"></div>
         <script  language="javascript" type='text/javascript'>     
             $(function(){
                 $.get("/qq_34413570/svc/GetSuggestContent/51373884",function(data){
                     $("#suggest").html(data);
                 });     
             });             
         </script>  


<style>
.blog-ass-articl dd {
color: #369;
width: 99%; /*修改行*/
float: left;
overflow: hidden;
font: normal normal 12px/23px "SimSun";
height: 23px;
margin: 0;
padding: 0 0 0 10px;
margin-right: 30px;
background: url(http://static.blog.csdn.net/skin/default/images/blog-dot-red3.gif) no-repeat 0 10px;
}
</style>

 <link rel="stylesheet" href="http://static.blog.csdn.net/css/replace.css"/>
<div id="relate" data-mod="popu_218"  class="tracking-ad">
        <div class="relate_t">
            <h3><span>参考知识库</span></h3>
        </div>
        <div class="relate_c">
        </div>
</div>
 

<dl class="blog-ass-articl" id="res-relatived" > 
    <div class="embody embody_b" id="libkeyparent"  style="display:none">
            <span class="embody_t">更多资料请参考：</span>
            <div class="embody_c" id="libkey"></div>
    </div>


     <dt><span>猜你在找</span></dt>    


   


    <div id="adCollege" style="width: 42%;float: left;"> 
        <script src="http://csdnimg.cn/jobreco/job_reco.js" type="text/javascript"></script> 
        <script type="text/javascript">
            csdn.position.showEdu({
                sourceType: "blog",
                searchType: "detail",
                searchKey: "51373884",
                username: "",
                recordcount: "5",
                containerId: "adCollege" //容器DIV的id。 
            });
            
            setEduLoc();

            function setEduLoc() {               
                var edus = $("#adCollege div dd a");
                if (edus.length == 0) {
                    setTimeout(function () {
                        setEduLoc();
                    }, 500);
                }
                else {
                    var eduLoc = "?ref=blog&loc=0";
                    $.each(edus, function (index,item) {
                        var href = $(this).attr("href") + eduLoc;
                        $(this).attr("href", href);
                    });
                }
            }

        </script> 
    </div>  

    
     <div id="res"  data-mod="popu_36"  class="tracking-ad" style="width: 42%;float: left;margin-right: 30px;"></div>
   
</dl>


<script type="text/javascript">
    $(function () {
        setTimeout(function () {
            var searchtitletags = '原创springmvc+spring3+hibernate4框架整合,实现增删改查功能' + ',' + $("#tags").html();
            searchService({
                index: 'blog',
                query: searchtitletags,
                from: 5,
                size: 5,
                appendTo: '#res',
                url: 'recommend',
                his: 2,
                client: "blog_cf_enhance",
                tmpl: '<dd style="background:url(http://static.blog.csdn.net/skin/default/images/blog-dot-red3.gif) no-repeat 0 10px;"><a href="#{ url }" title="#{ title }" strategy="#{ strategy }">#{ title }</a></dd>'
            });
        }, 500);
    });    

 </script>  


    <div id="ad_cen">        
                      <ins data-revive-zoneid="199" data-revive-id="8c38e720de1c90a6f6ff52f3f89c4d57"></ins>
    </div>  

    <!-- 广告位开始 -->
    <ins data-revive-zoneid="72" data-revive-id="8c38e720de1c90a6f6ff52f3f89c4d57"></ins>
    <!-- 广告位结束 -->

<div class="comment_class">
    <div id="comment_title" class="panel_head">
        <span class="see_comment">查看评论</span><a name="comments"></a></div>
    <div id="comment_list">
    </div>
    <div id="comment_bar">
    </div>
    <div id="comment_form">
    </div>
    <div class="announce">
        * 以上用户言论只代表其个人观点，不代表CSDN网站的观点或立场<a name="reply"></a><a name="quote"></a></div>
</div>

<script type="text/javascript">
    var fileName = '51373884';
    var commentscount = 5;
    var islock = false
</script>
<script type="text/javascript" src="http://static.blog.csdn.net/scripts/comment.js"></script>
    <div id="ad_bot">
    </div>
<div id="report_dialog">
</div>

<div id="d-top"  style="bottom:60px;">

        <a id="quick-reply" class="btn btn-top q-reply" title="快速回复" style="display:none;">
            <img src="http://static.blog.csdn.net/images/blog-icon-reply.png" alt="快速回复">
        </a>    
    <a id="d-top-a" class="btn btn-top backtop"  style="display: none;" title="返回顶部" onclick="_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_huidaodingbu'])" style="">         
         <img src="http://static.blog.csdn.net/images/top.png" alt="TOP">
    </a>
</div>
<script type="text/javascript">
    $(function ()
    {
        $("#ad_frm_0").height("90px");
        
        setTimeout(function(){
            $("#ad_frm_2").height("200px");
        },1000);    
    });
  
</script>
<style type="text/css">
    .tag_list
    {
        background: none repeat scroll 0 0 #FFFFFF;
        border: 1px solid #D7CBC1;
        color: #000000;
        font-size: 12px;
        line-height: 20px;
        list-style: none outside none;
        margin: 10px 2% 0 1%;
        padding: 1px;
    }
    .tag_list h5
    {
        background: none repeat scroll 0 0 #E0DBD3;
        color: #47381C;
        font-size: 12px;
        height: 24px;
        line-height: 24px;
        padding: 0 5px;
        margin: 0;
    }
    .tag_list h5 a
    {
        color: #47381C;
    }
    .classify
    {
        margin: 10px 0;
        padding: 4px 12px 8px;
    }
    .classify a
    {
        margin-right: 20px;
        white-space: nowrap;
    }
</style>


<div class="tag_list" style="display:none"></div>
  <script  language="javascript" type='text/javascript'>     
      $(function(){
              setTimeout(function(){
                  $.get("/qq_34413570/svc/GetTagContent",function(data){
                      $(".tag_list").html(data).show();
                  });     
              });
          },500);                       
 </script> 


<div id="pop_win" style="display:none ;position: absolute; z-index: 10000; border: 1px solid rgb(220, 220, 220); top: 222.5px; left: 630px; opacity: 1; background: none 0px 0px repeat scroll rgb(255, 255, 255);">
    
</div>
<div id="popup_mask"></div>
<style>
    #popup_mask
    {
        position: absolute;
        width: 100%;
        height: 100%;
        background: #000;
        z-index: 9999;
        left: 0px;
        top: 0px;
        opacity: 0.3;
        filter: alpha(opacity=30);
        display: none;
    }

</style>




<script type="text/javascript">
    $(function(){        
        
        setTimeout(function(){
            $(".comment_body:contains('回复')").each(function(index,item){
                var u=$(this).text().split('：')[0].toString().replace("回复","")
                var thisComment=$(this);
                if(u)
                {
                    $.getJSON("https://passport.csdn.net/get/nick?callback=?", {users: u}, function(a) {
                        if(a!=null&&a.data!=null&&a.data.length>0)
                        {
                            nick=a.data[0].n; 
                            if(u!=nick)
                            {
                                thisComment.text(thisComment.text().replace(u,nick));  
                            }
                        }       
                    });  
                }
            });         

        },200);  

        setTimeout(function(){
            $(".math").each(function(index,value){$(this).find("span").last().css("color","#fff"); })
        },5000);

        setTimeout(function(){
            $(".math").each(function(index,value){$(this).find("span").last().css("color","#fff"); })
        },10000);

        setTimeout(function(){
            $(".math").each(function(index,value){$(this).find("span").last().css("color","#fff"); })
        },15000);
        
        setTimeout(function(){
            $("a img[src='http://js.tongji.linezing.com/stats.gif']").parent().css({"position":"absolute","left":"50%"});
        },300);
    });

    function loginbox(){
        var $logpop=$("#pop_win");
        $logpop.html('<iframe src="https://passport.csdn.net/account/loginbox?service=http://static.blog.csdn.net/callback.htm" frameborder="0" height="600" width="400" scrolling="no"></iframe>');

        $('#popup_mask').css({
            opacity: 0.5,
            width: $( document ).width() + 'px',
            height:  $( document ).height() + 'px'
        });
        $('#popup_mask').css("display","block");
 
        $logpop.css( {
            top: ($( window ).height() - $logpop.height())/ 2  + $( window 
       ).scrollTop() + 'px',
            left:($( window ).width() - $logpop.width())/ 2
        } );
 
        setTimeout( function () {
            $logpop.show();
            $logpop.css( {
                opacity: 1
            } );
        }, 200 );
 
        $('#popup_mask').unbind("click");
        $('#popup_mask').bind("click", function(){
            $('#popup_mask').hide();
            var $clopop = $("#pop_win");
            $("#common_ask_div_sc").css("display","none");
            $clopop.css( {
                opacity: 0
            } );
            setTimeout( function () {
                $clopop.hide();
            }, 350 );
            return false;
        });
    }   

</script>
 <script language="javascript" type="text/javascript" src="http://ads.csdn.net/js/async_new.js"></script>      




                        <div class="clear">
                        </div>
                    </div>                   
                
            </div>
                   
           <div id="side">
               
    <div class="side">
<div id="panel_Profile" class="panel">
<ul class="panel_head"><span>个人资料</span></ul>
<ul class="panel_body profile">
<div id="blog_userface">
    <a href="http://my.csdn.net/qq_34413570" target="_blank">
    <img src="http://avatar.csdn.net/D/E/7/1_qq_34413570.jpg" title="访问我的空间" style="max-width:90%"/>
    </a>
    <br />
    <span><a href="http://my.csdn.net/qq_34413570" class="user_name" target="_blank">qq_34413570</a></span>
</div>
<div class="interact">

    <a href="javascript:void(0);" class="attent" id="span_add_follow" title="[加关注]"></a>

 <a href="javascript:void(0);" class="letter"  title="[发私信]" onclick="window.open('http://msg.csdn.net/letters/model?receiver=qq_34413570','_blank','height=350,width=700');_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_sixin'])"></a>  
</div>
<div id="blog_medal">
                <div id="bms_box">
               </div>
</div>
<ul id="blog_rank">
    <li>访问：<span>14715次</span></li>
    <li>积分：<span>130</span> </li>    
    <li >等级： <span style="position:relative;display:inline-block;z-index:1" >
            <img src="http://c.csdnimg.cn/jifen/images/xunzhang/jianzhang/blog2.png" alt="" style="vertical-align: middle;" id="leveImg">
            <div id="smallTittle" style=" position: absolute;  left: -24px;  top: 25px;  text-align: center;  width: 101px;  height: 32px;  background-color: #fff;  line-height: 32px;  border: 2px #DDDDDD solid;  box-shadow: 0px 2px 2px rgba (0,0,0,0.1);  display: none;   z-index: 999;">
            <div style="left: 42%;  top: -8px;  position: absolute;  width: 0;  height: 0;  border-left: 10px solid transparent;  border-right: 10px solid transparent;  border-bottom: 8px solid #EAEAEA;"></div>
            积分：130 </div>
        </span>  </li>
    <li>排名：<span>千里之外</span></li>
</ul>
<ul id="blog_statistics">
    <li>原创：<span>2篇</span></li>
    <li>转载：<span>0篇</span></li>
    <li>译文：<span>0篇</span></li>
    <li>评论：<span>5条</span></li>
</ul>
</ul>
</div>


<div class="panel" id="panel_Search">
    <ul class="panel_head"><span>文章搜索</span></ul>
    <ul class="panel_body">
        <form id="frmSearch" action="http://so.csdn.net/search" class="form_search" target="_blank">
        <span><input id="inputSearch" type="text" class="blogsearch" title="请输入关键字" /></span>
        <input id="btnSubmit" type="button" value="搜索" title="search in blog" />
        <input type="hidden" name="q" id="inputQ" />
        <input type="hidden" name="t" value="blog" />
        <a id="btnSearchBlog" target="_blank"></a>
        </form>
    </ul>
</div>

<script type="text/javascript">
    $(function () {
        $("#btnSubmit").click(function () {           
            search();
        });

        $("#frmSearch").submit(function () {
            search();
            return false;
        });

        function search()
        {
            var url = "http://so.csdn.net/so/search/s.do?q=" + encodeURIComponent($("#inputSearch").val()) + "&u=" + username + "&t=blog";
            window.location.href = url;
        }   
    });
</script><div id="panel_Category" class="panel">
<ul class="panel_head"><span>文章分类</span></ul>
<ul class="panel_body">    
                 <li>
                    <a href="/qq_34413570/article/category/6224061" onclick="_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_wenzhangfenlei']); ">框架整合</a><span>(0)</span>
                </li>
                 <li>
                    <a href="/qq_34413570/article/category/6439457" onclick="_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_wenzhangfenlei']); ">java功能</a><span>(1)</span>
                </li>
                 <li>
                    <a href="/qq_34413570/article/category/6439458" onclick="_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_wenzhangfenlei']); ">控件</a><span>(0)</span>
                </li>
</ul>
</div><div id="panel_Archive" class="panel">
<ul class="panel_head"><span>文章存档</span></ul>
<ul class="panel_body">
<div id="archive_list">
<!--归档统计-->
<li><a href="/qq_34413570/article/month/2016/09">2016年09月</a><span>(1)</span></li><li><a href="/qq_34413570/article/month/2016/05">2016年05月</a><span>(1)</span></li>
</div>
</ul>
</div>
<div id="hotarticls" class="panel">
<ul class="panel_head">
    <span>       
阅读排行    </span>
</ul>

<ul class="panel_body itemlist">
<li>
<a href="/qq_34413570/article/details/51373884" title="原创springmvc+spring3+hibernate4框架整合,实现增删改查功能">原创springmvc+spring3+hibernate4框架整合,实现增删改查功能</a><span>(12896)</span>
</li>
<li>
<a href="/qq_34413570/article/details/52687552" title="后台传的json串页面生成树">后台传的json串页面生成树</a><span>(559)</span>
</li>
</ul>
</div>
<div id="hotarticls2" class="panel">
<ul class="panel_head"><span>评论排行</span></ul>
<ul class="panel_body itemlist">
<li>
<a href="/qq_34413570/article/details/51373884" title="原创springmvc+spring3+hibernate4框架整合,实现增删改查功能">原创springmvc+spring3+hibernate4框架整合,实现增删改查功能</a><span>(5)</span>
</li>
<li>
<a href="/qq_34413570/article/details/52687552" title="后台传的json串页面生成树">后台传的json串页面生成树</a><span>(0)</span>
</li>
</ul>
</div>
<div id="homepageArticles" class="panel tracking-ad" data-mod="popu_4">
<ul class="panel_head"><span>推荐文章</span></ul>
<ul class="panel_body" id="ad_commend">
<ul>
<li><a href="http://blog.csdn.net/u010278923/article/details/70186182" target="_blank">* 云计算的那些事儿之计算虚拟化</a></li>
<li><a href="http://blog.csdn.net/congyihao/article/details/70195154" 
target="_blank">* 微服务--分布式事务的实现方法及替代方案</a></li>
<li><a href="http://blog.csdn.net/my_truelove/article/details/70196028"target="_blank">* 你应该知道的 Android 数据库更新策略</a></li>
<li><a href="http://blog.csdn.net/androidlushangderen/article/details/70195430" 
target="_blank">* HDFS副本放置节点选择的优化</a></li>
<li><a href="http://blog.csdn.net/blogdevteam/article/details/70197331" 
target="_blank">* CSDN日报20170416 ——《为什么程序员话少钱多死得早？》</a></li>
<li><a href="http://blog.csdn.net/tenkywoo/article/details/70176224" 
target="_blank">* 凡人视角C++之string(上)</a></li>

</ul></ul>
</div>


<div id="newcomments" class="panel">
<ul class="panel_head"><span>最新评论</span></ul>
<ul class="panel_body itemlist">
    <li>
   
         <a href="/qq_34413570/article/details/51373884#comments">原创springmvc+spring3+hibernate4框架整合,实现增删改查功能</a>
    <p style="margin:0px;"><a href="/yumingxiao2011" class="user_name">yumingxiao2011</a>:
ding
    </p>
    </li>
    <li>
   
         <a href="/qq_34413570/article/details/51373884#comments">原创springmvc+spring3+hibernate4框架整合,实现增删改查功能</a>
    <p style="margin:0px;"><a href="/yumingxiao2011" class="user_name">yumingxiao2011</a>:
ding
    </p>
    </li>
    <li>
   
         <a href="/qq_34413570/article/details/51373884#comments">原创springmvc+spring3+hibernate4框架整合,实现增删改查功能</a>
    <p style="margin:0px;"><a href="/chenxie0721" class="user_name">chenxie0721</a>:
跑通了哥们，不好意思，代码太牛逼，刚才没看懂
    </p>
    </li>
    <li>
   
         <a href="/qq_34413570/article/details/51373884#comments">原创springmvc+spring3+hibernate4框架整合,实现增删改查功能</a>
    <p style="margin:0px;"><a href="/chenxie0721" class="user_name">chenxie0721</a>:
走不通啊，先导入hibernate框架还是先导入spring框架，那些包不是在导框架的时候添加的吗
    </p>
    </li>
    <li>
   
         <a href="/qq_34413570/article/details/51373884#comments">原创springmvc+spring3+hibernate4框架整合,实现增删改查功能</a>
    <p style="margin:0px;"><a href="/eson_15" class="user_name">eson_15</a>:
顶一个
    </p>
    </li>
</ul>
</div>
    </div>
    <div class="clear">
    </div>


                 <!-- 广告位开始 --> 
                    <ins data-revive-zoneid="189" data-revive-id="8c38e720de1c90a6f6ff52f3f89c4d57"></ins> 
                <!-- 广告位结束 -->

           </div>   

            <div class="clear">
            </div>
        </div>

        

<script type="text/javascript" src="http://c.csdnimg.cn/rabbit/cnick/cnick.js"></script>
<script type="text/javascript" src="http://static.blog.csdn.net/scripts/newblog.min.js"></script>


<script type="text/javascript" src="http://medal.blog.csdn.net/showblogmedal.ashx?blogid=5654518"></script>
<script type="text/javascript" src="http://static.blog.csdn.net/scripts/JavaScript1.js"></script>

    <script type="text/javascript" src="http://passport.csdn.net/content/loginbox/login.js"></script>
<script type="text/javascript">document.write("<img src=http://counter.csdn.net/pv.aspx?id=24 border=0 width=0 height=0>");</script>
<script type="text/javascript" src="http://www.csdn.net/ui/scripts/Csdn/counter.js"></script>
<script type="text/javascript" src="http://ad.csdn.net/scripts/ad-blog.js"></script>
<script type="text/javascript">
    $(function () {
        function __get_code_toolbar(snippet_id) {
            return $("<span class='tracking-ad' data-mod='popu_167'><a href='https://code.csdn.net/snippets/"
                    + snippet_id
                    + "' target='_blank' title='在CODE上查看代码片'  style='text-indent:0;'><img src='https://code.csdn.net/assets/CODE_ico.png' width=12 height=12 alt='在CODE上查看代码片' style='position:relative;top:1px;left:2px;'/></a></span>"
                    + "<span class='tracking-ad' data-mod='popu_170'><a href='https://code.csdn.net/snippets/"
                    + snippet_id
                    + "/fork' target='_blank' title='派生到我的代码片' style='text-indent:0;'><img src='https://code.csdn.net/assets/ico_fork.svg' width=12 height=12 alt='派生到我的代码片' style='position:relative;top:2px;left:2px;'/></a></span>");
        }
        
        $("[code_snippet_id]").each(function () {
            __s_id = $(this).attr("code_snippet_id");
            if (__s_id != null && __s_id != "" && __s_id != 0 && parseInt(__s_id) > 70020) {
                __code_tool = __get_code_toolbar(__s_id);
                $(this).prev().find(".tools").append(__code_tool);
            }
        });

        $(".bar").show();
    });
</script>





    </div>
      <!--new top-->
    
    <script id="csdn-toolbar-id" btnId="header_notice_num" wrapId="note1" count="5" subCount="5" type="text/javascript" src="http://c.csdnimg.cn/public/common/toolbar/js/toolbar.js"></script>     <!--new top-->
   
    <link href="http://c.csdnimg.cn/comm_ask/css/ask_float_block.css" type="text/css" rel="stylesheet" />
    <script language='JavaScript' type='text/javascript' src='http://c.csdnimg.cn/comm_ask/js/libs/wmd.js'></script>
    <script language='JavaScript' type='text/javascript' src='http://c.csdnimg.cn/comm_ask/js/libs/showdown.js'></script>
    <script language='JavaScript' type='text/javascript' src='http://c.csdnimg.cn/comm_ask/js/libs/prettify.js'></script>
    <script language='JavaScript' type='text/javascript' src='http://c.csdnimg.cn/comm_ask/js/apps/ask_float_block.js'></script>
   

   

  <div id="a52b5334d" style="width: 1px; height: 1px; display: none;">
                    <script id="adJs52b5334"></script>
                    <script>document.getElementById("adJs52b5334").src = "http://ads.csdn.net/js/opt/52b5334.js?t=" + Math.random();</script>
   </div>

    <link rel="stylesheet" href="http://static.blog.csdn.net/css/blog_code.css" />
    <script type="text/javascript" src="http://static.blog.csdn.net/scripts/saveToCode.js"></script>
      <script type="text/javascript" src="//csdnimg.cn/rabbit/tracking-ad/main.js?75eacd8"></script>

     <link rel="stylesheet" href="http://static.blog.csdn.net/css/fa.css" />

    <div class="pop_CA_cover"  style="display:none"></div>
    <div class="pop pop_CA"  style="display:none">
          <div class="CA_header">
            收藏助手
            <span class="cancel_icon"  id="fapancle"  onclick="$('.pop_CA').hide();$('.pop_CA_cover').hide();"></span>
          </div>
          <iframe src="" id="fa" frameborder="0" width="100%" height="360"  scrolling="no" />
    </div>
</body>
</html>   
 